package com.dxq.test.db;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.io.Serializable;

/**
 * Author: zsh
 * Date: 2023/10/18
 * Describe: 牲畜配种表（字段）
 */
@DatabaseTable(tableName = "Breed")
public class Breed implements Serializable {

    public final static String ID_FIELD_NAME = "breed_id";

    // id = true:表明这个字段是这条记录的唯一标志符, generatedId = true:表明自动增加的ID
    //序号
    @DatabaseField(generatedId = true, columnName = ID_FIELD_NAME)
    private int breed_id;

    //编号
    @DatabaseField(columnName = "code")
    private String code;

    //配种时间
    @DatabaseField(columnName = "time")
    private String time;

    //二次配种时间
    @DatabaseField(columnName = "next_time")
    private String next_time;

    //预产时间
    @DatabaseField(columnName = "birth_time")
    private String birth_time;

    //是否开启滚动提醒(预产时间)
    @DatabaseField(columnName = "birth_time_remind")
    private boolean birth_time_remind;

    //是否开启滚动提醒(二次配种时间)
    @DatabaseField(columnName = "next_time_remind")
    private boolean next_time_remind;

    //备注
    @DatabaseField(columnName = "remark")
    private String remark;

    //所属牧场  牧场--外键
    @DatabaseField(columnName = "pasture_id", foreign = true, foreignAutoRefresh = true, foreignAutoCreate = true)
    private Pasture pasture_id;//序号

    //配种对应的牲畜信息（公）
    @DatabaseField(persisted = false)//如果设置为false，表示这个字段不会写到数据库中
    private Label label_m;

    //配种对应的牲畜信息（母）
    @DatabaseField(persisted = false)//如果设置为false，表示这个字段不会写到数据库中
    private Label label_w;

    public Breed() {
    }

    public Breed(String code, String time, String birth_time, String next_time, boolean birth_time_remind,
                 boolean next_time_remind, String remark, Pasture pasture_id) {
        this.code = code;
        this.time = time;
        this.birth_time = birth_time;
        this.next_time = next_time;
        this.birth_time_remind = birth_time_remind;
        this.next_time_remind = next_time_remind;
        this.remark = remark;
        this.pasture_id = pasture_id;
    }

    public int getBreed_id() {
        return breed_id;
    }

    public void setBreed_id(int breed_id) {
        this.breed_id = breed_id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getNext_time() {
        return next_time;
    }

    public void setNext_time(String next_time) {
        this.next_time = next_time;
    }

    public String getBirth_time() {
        return birth_time;
    }

    public void setBirth_time(String birth_time) {
        this.birth_time = birth_time;
    }

    public boolean isBirth_time_remind() {
        return birth_time_remind;
    }

    public void setBirth_time_remind(boolean birth_time_remind) {
        this.birth_time_remind = birth_time_remind;
    }

    public boolean isNext_time_remind() {
        return next_time_remind;
    }

    public void setNext_time_remind(boolean next_time_remind) {
        this.next_time_remind = next_time_remind;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Pasture getPasture_id() {
        return pasture_id;
    }

    public void setPasture_id(Pasture pasture_id) {
        this.pasture_id = pasture_id;
    }

    public Label getLabel_m() {
        return label_m;
    }

    public void setLabel_m(Label label_m) {
        this.label_m = label_m;
    }

    public Label getLabel_w() {
        return label_w;
    }

    public void setLabel_w(Label label_w) {
        this.label_w = label_w;
    }

    @Override
    public String toString() {
        return "Breed{" +
                "breed_id=" + breed_id +
                ", code='" + code + '\'' +
                ", time='" + time + '\'' +
                ", next_time='" + next_time + '\'' +
                ", birth_time='" + birth_time + '\'' +
                ", birth_time_remind=" + birth_time_remind +
                ", next_time_remind=" + next_time_remind +
                ", remark='" + remark + '\'' +
                ", label_m=" + label_m +
                ", label_w=" + label_w +
                '}';
    }
}
